using DataLayer.Repositories;
using DataLayer.Utils;
using NHibernate;
using Ninject.Modules;

namespace DataLayer.Ninject
{
    public class DataLayerNinjectModule : NinjectModule
    {
        public override void Load()
        {
            Bind<ISessionFactory>().ToConstant(new NHibernateSessionFactory().CreateSessionFactory());
            Bind<ISession>().ToProvider<NHSessionProvider>();

            Bind<IPublishersRepository>().To<PublishersRepository>();
            Bind<ISubscribersRepository>().To<SubscribersRepository>();
            Bind<ISubscriptionsRepository>().To<SubscriptionsRepository>();
            Bind<IMessageAssembliesRepository>().To<MessageAssembliesRepository>();
        }
    }
}